<template>
  <div>
    <h1>首页</h1>
    <el-row gutter="25">
      <el-col :span="8">
        <div class="grid-content bg-purple">
          <div class="diva">
            <h1>{{ statistica.userCount }}</h1>
            <p>用户总数</p>
          </div>
        </div>
      </el-col>
      <el-col :span="8">
        <div class="grid-content bg-purple">
          <div class="diva">
            <h1>{{ statistica.productCount }}</h1>
            <p>用户总数</p>
          </div>
        </div>
      </el-col>
      <el-col :span="8">
        <div class="grid-content bg-purple">
          <div class="diva">
            <h1>{{ statistica.orderCount }}</h1>
            <p>用户总数</p>
          </div>
        </div>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import { statistic } from "../../../http/http";
export default {
  name: "",
  components: {},
  props: [],
  data() {
    return {
      statistica: {},
    };
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {
    this.statistic();
  },
  methods: {
    //   数据统计
    async statistic() {
      const { data: res } = await statistic();
      console.log(res);
      this.statistica = res.data;
    },
  },
};
</script>

<style lang='scss' scoped>
.el-row {
  margin-bottom: 20px;
  &:last-child {
    margin-bottom: 0;
  }
}
.el-col {
  border-radius: 4px;
}
.bg-purple-dark {
  background: #99a9bf;
}
.bg-purple {
  background: #d3dce6;
}
.bg-purple-light {
  background: #e5e9f2;
}
.grid-content {
  border-radius: 4px;
  min-height: 36px;
}
.row-bg {
  padding: 10px 0;
  background-color: #f9fafc;
}
.diva {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 160px;
  color: white;
  background: #f0ad4e;
  > h1 {
    font-size: 35px;
  }
}
.grid-content:hover {
  transform: scale(1.06);
  transition: all 1s;
}
</style>
